feat(nav): render Preview badges consistently#721
Conversation
|
@qiancai is attempting to deploy a commit to the test-vi Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where TOC images without query parameters would emit a bogus ?undefined query, adds corresponding unit tests, and introduces translation support for the 'PREVIEW' badge in the left navigation tree. The review feedback focuses on improving type safety by avoiding unsafe non-null assertions on image.alt, and optimizing the LeftNavTree component by leveraging MUI's built-in theme resolution for custom palette colors, which simplifies the generateItemLabel function signature and prevents potential runtime errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Avoid creating invalid navigation tags for TOC images without alt text.\n\nAddresses review comments #3557222898 and #3557222909.
Reuse the shared Preview badge for the TiDB for AI left navigation title and remove the now-unused Beta badge component and translations.
Share one PreviewBadge component between directory titles and TOC entries so their visual treatment stays identical.
Remove the unintended flexShrink override from the shared badge and resolve the Preview translation once per left-nav render.
Purpose
Render PREVIEW labels consistently across documentation navigation, including TOC image tags and the TiDB for AI left navigation title, using the existing neutral, localized Preview badge style.
Scope
Validation
Notes
PREVIEW TOC tags intentionally ignore a source color query parameter so their badge appearance remains consistent.